#pragma once
namespace ne{
	static const int KEYBOARD_KEYS = 237;	// 237 is the total ammount of keys for OIS::KC_X
	static const int MOUSE_BUTTONS = 7;		// 7 is the total ammount of mouse button for OIS Mouse Button ID
	static const int JOYSTICK_POVS = 9;		// number taken from OISJoystick.h, ammount of povs defined as static const int

	class JoyStick : public OIS::JoyStickListener {
	public:
		JoyStick(OIS::JoyStick* joystick);
		~JoyStick(void);
		void Capture();
		bool IsButtonDown(int button);
		bool IsButtonPressed(int button);
		bool IsButtonReleased(int button);
		float GetAxis(int axis);
		int GetPov();
		bool IsPovDown(int pov);
		bool IsPovPressed(int pov);
		bool IsPovReleased(int pov);

		bool povMoved(const OIS::JoyStickEvent& e, int pov);
		bool axisMoved(const OIS::JoyStickEvent& e, int axis);
		bool sliderMoved(const OIS::JoyStickEvent& e, int slider);
		bool buttonPressed(const OIS::JoyStickEvent& e, int button);
		bool buttonReleased(const OIS::JoyStickEvent& e, int button);

		OIS::JoyStick* GetJoyStick() const { return m_joystick; }
	private:
		OIS::JoyStick* m_joystick;
		int m_numButtons;
		bool* m_buttons;
		bool* m_lastButtons;
		int m_pov;
		int m_lastPov;
	};

	enum EButtonType{
		BTN_TYPE_KEYBOARD = 0,
		BTN_TYPE_MOUSE,
		BTN_TYPE_JOYSTICK
	};
}

